<html>

<head></head>

<body>
    <div id="app">
    </div>

    <script src="https://unpkg.com/vue"></script>
    <script>
        var appFactory = {

            buildTemplate: function () {
                return '<div><p style="color:red;">Hello app </p><p> {{ message }} </p></div>'
            },

            buildData: function () {
                return { message: 'app message'}
            }
        }

        var testFactory = {

            buildTemplate: function () {
                return '<div><p style="color:red;">Hello test </p><p> {{ message }} </p></div>'
            },

            buildData: function () {
                return { message: 'test message'}
            }
        }

        var factory = testFactory // appFactory
        var buildApp = function () {
            var template = factory.buildTemplate()
            var data = factory.buildData()
            console.log(data)
            return new Vue({
                el: '#app',
                template: template,
                data: data
            })
        }

        buildApp()
    </script>
</body>

</html>